//
//  SingletonLoginSocket.swift
//  flowerpot
//
//  Created by fyname on 15/12/29.
//  Copyright © 2015年 senhe. All rights reserved.
//

import Foundation
import Starscream

class SingletonLoginSocket{
    
    let webSocket = WebSocket(url: NSURL(string: "ws://\(Common.localhost):8088/weijia-wim-web/user/login")!)
    
    class var sharedInstance : SingletonLoginSocket {
        struct Static {
            static let instance:SingletonLoginSocket = SingletonLoginSocket()
        }
        if(!Static.instance.webSocket.isConnected){
            Static.instance.webSocket.connect()
        }
        return Static.instance
    }
    
}